package edu.scau.misp.backend_module.core.rms_dto;

import edu.scau.misp.backend_module.domain.DishAddition;

public class ProductDTO {



    /**
     * 重新装载后端发往前端的结构数据；
     * 需要组合能够查询后端的变量，以及存放查询和结果的集合；
     */
    /**
     * product 即 addition和 dish 的组合；
     * 需要提供用于搜查和呈现结果的变量；
     */


    
    private Long productSn;


    /**
     *实体类：Dish
     *private String dishName;
     */
    private String productName;

    /**
     *实体类：Addition
     *private String additionDescription;
     */
    private String flavor;

    /**
     *实体类：DishAddiction
     *private Long comboPrice;
     */
    private Long productPrice;

    /**
     *实体类：Dish
     * private String dishDescription;
     */
    private String productDescription;
    /**
     *实体类：Dish
     */
    private Long isAvailable;
    /**
     *实体类：Dish
     */
    private String imageUrl;

//    private String comboDescription;

    public ProductDTO() {
    }

    public ProductDTO(Long productSn, String productName, String flavor, Long productPrice, String productDescription, Long isAvailable, String imageUrl) {
        this.productSn = productSn;
        this.productName = productName;
        this.flavor = flavor;
        this.productPrice = productPrice;
        this.productDescription = productDescription;
        this.isAvailable = isAvailable;
        this.imageUrl = imageUrl;
    }

    @Override
    public String toString() {
        return "ProductDTO{" +
                "productSn=" + productSn +
                ", productName='" + productName + '\'' +
                ", flavor='" + flavor + '\'' +
                ", productPrice=" + productPrice +
                ", productDescription='" + productDescription + '\'' +
                ", isAvailable=" + isAvailable +
                ", imageUrl='" + imageUrl + '\'' +
                '}';
    }

    public Long getProductSn() {
        return productSn;
    }

    public void setProductSn(Long productSn) {
        this.productSn = productSn;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getFlavor() {
        return flavor;
    }

    public void setFlavor(String flavor) {
        this.flavor = flavor;
    }

    public Long getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(Long productPrice) {
        this.productPrice = productPrice;
    }

    public String getProductDescription() {
        return productDescription;
    }

    public void setProductDescription(String productDescription) {
        this.productDescription = productDescription;
    }

    public Long getIsAvailable() {
        return isAvailable;
    }

    public void setIsAvailable(Long isAvailable) {
        this.isAvailable = isAvailable;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

//    public String getComboDescription() {
//        return comboDescription;
//    }
//
//    public void setComboDescription(String comboDescription) {
//        this.comboDescription = comboDescription;
//    }

    public ProductDTO(DishAddition dishAddition) {
//        product.setProductSn(param.getDishAdditionSn());
//        product.setProductName(param.getDish().getDishName());
//        product.setFlavor(param.getAddition().getAdditionDescription());
//        product.setProductPrice(param.getComboPrice());
//        product.setProductDescription(param.getDish().getDishDescription());
//        product.setIsAvailable(param.getDish().getIsAvailable());
//        product.setImageUrl(param.getDish().getImageUrl());
        this.productSn = dishAddition.getDishAdditionSn();
        this.productName = dishAddition.getDish().getDishName();
        this.flavor = dishAddition.getAddition().getAdditionDescription();
        this.productPrice = dishAddition.getComboPrice();
        this.productDescription = dishAddition.getDish().getDishDescription();
        this.isAvailable = dishAddition.getDish().getIsAvailable();
        this.imageUrl = dishAddition.getDish().getImageUrl();
//        this.comboDescription = dishAddition.getComboDescription();
    }


}
